* Table 11
* "Publishers" by category
* Years 2001,2009,2018
local table "Table11"
use "./data/academics.dta", clear
createvarsacad
keep if tenure
qui putexcel set "./tables/tables.xlsx", sheet("`table'") modify
gen publisher=person_id<.
qui putexcel C1=("Published")
qui putexcel B2=("2001")
qui putexcel C2=("2009")
qui putexcel D2=("2018")
qui putexcel A3=("Assistant")
qui putexcel A4=("Associate")
qui putexcel A5=("Full")
qui putexcel A6=("All")
* Publisher
qui sum publisher if year==2001 & newcat==10, meanonly /* PROFESSOR AUXILIAR */
qui putexcel B3=(`r(mean)'), nformat(#.0%)
qui sum publisher if year==2009 & newcat==10, meanonly /* PROFESSOR AUXILIAR */
qui putexcel C3=(`r(mean)'), nformat(#.0%)
qui sum publisher if year==2018 & newcat==10, meanonly /* PROFESSOR AUXILIAR */
qui putexcel D3=(`r(mean)'), nformat(#.0%)
qui sum publisher if year==2001 & newcat==8, meanonly /* PROFESSOR ASSOCIADO */
qui putexcel B4=(`r(mean)'), nformat(#.0%)
qui sum publisher if year==2009 & newcat==8, meanonly /* PROFESSOR ASSOCIADO */
qui putexcel C4=(`r(mean)'), nformat(#.0%)
qui sum publisher if year==2018 & newcat==8, meanonly /* PROFESSOR ASSOCIADO */
qui putexcel D4=(`r(mean)'), nformat(#.0%)
qui sum publisher if year==2001 & newcat==12, meanonly /* PROFESSOR CATEDRATICO */
qui putexcel B5=(`r(mean)'), nformat(#.0%)
qui sum publisher if year==2009 & newcat==12, meanonly /* PROFESSOR CATEDRATICO */
qui putexcel C5=(`r(mean)'), nformat(#.0%)
qui sum publisher if year==2018 & newcat==12, meanonly /* PROFESSOR CATEDRATICO */
qui putexcel D5=(`r(mean)'), nformat(#.0%)
qui sum publisher if year==2001 
qui putexcel B6=(`r(mean)'), nformat(#.0%)
qui sum publisher if year==2009 
qui putexcel C6=(`r(mean)'), nformat(#.0%)
qui sum publisher if year==2018 
qui putexcel D6=(`r(mean)'), nformat(#.0%)
